home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!friend!news
- From: rich@kastle.com (Richard Krehbiel)
- Subject: Re: realloc(NULL,100)
- Message-ID: <1996Mar4.153550.21003@friend.kastle.com>
- Sender: news@friend.kastle.com (News)
- Reply-To: rich@kastle.com
- Organization: Kastle Development Associates
- X-Newsreader: Forte Free Agent 1.0.82
- References: <31346CB0.41C67EA6@jupiter.di.uminho.pt> <TANMOY.96Feb28151825@qcd.lanl.gov> <1996Mar4.122207.16986@friend.kastle.com>
- Date: Mon, 4 Mar 1996 15:36:57 GMT
-
- rich@kastle.com (Richard Krehbiel) wrote:
-
- ...a typo. Whoops. That's what I get for not rigorously testing my
- (admittedly silly) postings. I should be flogged unto senselessness.
-
- >#include <stdio.h>
- >#include <stdlib.h>
-
- >int main(void)
- >{
- > void *p;
- > int i;
-
- > /* Try really hard, up to 100 times, to get the memory
- > I desparately need */
- > for(i = 0, p = NULL; p != NULL && i < 100; i++)
- --------- (that should say p == NULL)
-
- > p = malloc(100);
-
- > return p ? EXIT_SUCCESS : EXIT_FAILURE;
- >}
-
-
- --
- Richard Krehbiel, Kastle Systems, Arlington VA USA
- rich@kastle.com (work) or richk@mnsinc.com (personal)
-
-